package com.bdweb.service.impl;

import com.bdweb.dao.TaskDao;


import com.bdweb.model.TASK;

import com.bdweb.service.TaskService;

import org.apache.ibatis.annotations.Mapper;
import org.springframework.beans.factory.annotation.Autowired;


import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
@Component
public class TaskServiceImpl implements TaskService {
    @Autowired
    private TaskDao taskDao;


    @Override
    public List<TASK> findAllTask() {
        return taskDao.findAll();
    }

    @Override
    public TASK findTask(String taskName, String start1, String end1, String start2, String end2,boolean ischeckd ,String mobile ,String updataTime) {
        return taskDao.findByNameAndPwd(taskName, start1,end1,start2,end2,ischeckd,mobile,updataTime);
    }

    @Override
    public Integer addTask(TASK task) {
       return  taskDao.addByUser(task);
    }

    @Override
    public Integer deleteTask(Integer id) {
        return taskDao.deleteTaskById(id);
    }

    @Override
    public Integer updateTaskInfo(String taskName, String start1, String end1, String start2, String end2,boolean ischeckd ,String mobile,String updataTime) {
        return taskDao.updateNameAndPwdById(taskName, start1,end1,start2,end2,ischeckd,mobile,updataTime);
    }
}